package com.crealth.db;

import java.util.List;

import com.crealth.manager.MybatisManager;
import com.crealth.model.CityDistrictModel;

public class CityDistrictDb {

	public static Integer insertCityDistrict(CityDistrictModel cityDistrict) {
		Integer res = MybatisManager.ciryDistrictMapper.insertCityDistrict(cityDistrict);
		MybatisManager.commit();
		
		return res;
	}
    
	public static List<CityDistrictModel> selectAllCityDistrict() {
		List<CityDistrictModel> districtls = MybatisManager.ciryDistrictMapper.selectAllCityDistrict();
		
		return districtls;
	}
    
	public static Integer updateCityDistrict(CityDistrictModel cityDistrict) {
		Integer res = MybatisManager.ciryDistrictMapper.updateCityDistrict(cityDistrict);
		MybatisManager.commit();
		
		return res;
	}
	
	public static Integer deleteCityDistrictByID(int id) {
		Integer res = MybatisManager.ciryDistrictMapper.deleteCityDistrictByID(id);
		MybatisManager.commit();
		
		return res;
	}
	
}
